<?php

/*
|--------------------------------------------------------------------------
| Application Routes
|--------------------------------------------------------------------------
|
| Here is where you can register all of the routes for an application.
| It is a breeze. Simply tell Lumen the URIs it should respond to
| and give it the Closure to call when that URI is requested.
|
*/

$router->get('/', function () use ($router) {
    //return $router->app->version();
    return redirect('/admin/index.html');
});


//后台管理API
$router->group(['prefix'=>'/api/admin', 'namespace'=>'Admin'], function () use ($router) {
    $router->post('dologin', 'LoginController@dologin');
    $router->post('leftmenu', 'LoginController@leftMenu');
    $router->get('config/modify', 'LoginController@configSet');
    //模块管理
    $router->post('action/index', 'ActionController@index');
    $router->post('action/modify', 'ActionController@modify');
    //角色管理
    $router->post('role/index', 'RoleController@index');
    $router->post('role/modify', 'RoleController@modify');
    $router->post('role/del', 'RoleController@del');
    $router->post('role/actlist', 'RoleController@actList');
    $router->post('role/setauth', 'RoleController@setAuth');
    //=员工管理
    $router->post('staff/index', 'StaffController@index');
    $router->post('staff/option', 'StaffController@getOption');
    $router->post('staff/modify', 'StaffController@modify');
    $router->post('staff/toable', 'StaffController@toable');
//    $router->post('staff/del', 'StaffController@del');
    $router->post('staff/reset', 'StaffController@reset');
    $router->post('staff/pwdmodify', 'StaffController@pwdmodify');
    //连锁店
    $router->post('shop/index', 'ShopController@index');
    $router->post('shop/modify', 'ShopController@modify');
    //工单维修
    $router->post('weixiu/index', 'WeixiuController@index');
    $router->post('weixiu/modify', 'WeixiuController@modify');
    $router->post('weixiu/del', 'WeixiuController@del');
    $router->post('weixiu/go', 'WeixiuController@go');
    $router->post('weixiu/finish', 'WeixiuController@finish');
    //销售服务
    $router->post('sale/index', 'SaleController@index');
    $router->post('sale/modify', 'SaleController@modify');
    $router->post('sale/del', 'SaleController@del');
    //项目管理
    $router->post('pro/index', 'ProController@index');
    $router->post('pro/modify', 'ProController@modify');
    $router->post('pro/del', 'ProController@del');
    $router->post('pro/go', 'ProController@go');
    $router->post('pro/finish', 'ProController@finish');
});